package com.taotao.product.controller;

import com.taotao.common.core.domain.Result;
import com.taotao.product.service.IPmsItemInfoService;
import com.taotao.product.vo.ItemInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * @className: ItemController
 * @author: ZhangYuQi
 * @date: 2024/12/25 下午4:48
 * @Version: 1.0
 * @description:
 */

@RestController
@RequestMapping("item")
public class ItemController {

    @Autowired
    private IPmsItemInfoService iPmsItemInfoService;

    @GetMapping("/{skuId}")
    public Result<ItemInfoVo> getItemInfoBySkuId(@PathVariable("skuId") Long skuId) throws ExecutionException, InterruptedException {
        ItemInfoVo itemInfoBySkuId = iPmsItemInfoService.getItemInfoBySkuId(skuId);
        return Result.success(itemInfoBySkuId);
    }

}
